package com.fjwt.gz.mgr.ctrl.payAuth;


import cn.hutool.json.JSONUtil;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.db.entity.PayAuthEntity;
import com.fjwt.gz.mgr.ctrl.CommonCtrl;
import com.fjwt.gz.service.impl.PayAuthService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/***
 * 支付通道认证配置 Controller
 *
 */
@RestController
@Slf4j
@RequestMapping("/api/pay/auth")
public class PayAuthController extends CommonCtrl {


    @Autowired
    private PayAuthService payAuthService;


    /**
     * 查询出资方下拉列表
     * @return
     */
    @GetMapping
    public ApiRes allList() {
        List<PayAuthEntity> list = payAuthService.list();
        log.info("pc端查询出资方下拉列表，请求地址：/api/pay/auth，请求参数：{}", JSONUtil.toJsonStr(list));
        return ApiRes.ok(list);
    }
}
